package com.Eastiy.EXO.View;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Shader;
import android.text.TextPaint;
import android.widget.TextView;

public class LTextView extends TextView {
    private LinearGradient mLinearGradient;
    private Matrix mLinearMatrix;
    private TextPaint mPaint;
    private int mTranslate = 0;
    private int mViewWidth;

    public LTextView(Context context) {
        super(context);
    }

    /* access modifiers changed from: protected */
    @Override
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if (this.mLinearMatrix != null) {
            this.mTranslate += this.mViewWidth / 5;
            if (this.mTranslate > this.mViewWidth * 2) {
                this.mTranslate = -this.mViewWidth;
            }
            this.mLinearMatrix.setTranslate((float) this.mTranslate, (float) 0);
            this.mLinearGradient.setLocalMatrix(this.mLinearMatrix);
            canvas.translate((float) 10, (float) 300);
            postInvalidateDelayed((long) 60);
        }
    }

    /* access modifiers changed from: protected */
    @Override
    public void onSizeChanged(int i, int i2, int i3, int i4) {
        super.onSizeChanged(i, i2, i3, i4);
        if (this.mViewWidth == 0) {
            this.mViewWidth = getMeasuredWidth();
            this.mLinearMatrix = new Matrix();
            this.mLinearGradient = new LinearGradient((float) 0, (float) 0, (float) this.mViewWidth, (float) 0, new int[]{-2683136, -2803198, -2386687, -12805373, -16465745, -16645992, -11796105}, (float[]) null, Shader.TileMode.REPEAT);
            this.mPaint = getPaint();
            this.mPaint.setShader(this.mLinearGradient);
        }
    }
}
